<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:replace="main_layout::html_header(~{::link}, ~{::style})">
	<link rel="stylesheet" th:href="@{/lib/DataTables/1.10.15/datatables.min.css}" />
	<link rel="stylesheet" th:href="@{/lib/sweetalert2/6.6.5/sweetalert2.min.css}" />
	<link rel="stylesheet" th:href="@{/lib/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.min.css}" />
	<style type="text/css">
	.control-label {
		padding-right: 0px !important;
		padding-left: 0px !important;
	}
	.fix_radio {
		vertical-align:text-bottom;
	}
	</style>
</head>
 
<body class="hold-transition skin-blue fixed">
<div class="wrapper">

<header class="main-header" th:replace="main_layout::header">
</header>

<aside class="main-sidebar">
	<section class="sidebar" th:replace="main_layout::menu">
	</section>
</aside>

<div class="content-wrapper">
<section class="content-header">
	<h1><a th:href="@{/}">首页</a><small><a th:href="@{/apply/elec/one}">电子合同申请</a></small></h1>
</section>
	
<section class="content">

<div class="box box-info">
<div class="box-header">
	<div class="register-steps">
		<li>
			<i>1.</i>
			<span>选择合同模板</span>
		</li>
		<li class="active">
			<i>2.</i>
			<span>填写合同内容</span>
		</li>
		<li>
			<i>3.</i>
			<span>完成</span>
		</li>
	</div>
</div>
<div class="row">
<div class="col-sm-12" th:include="~{fragment/contract_template::${temp_id}}">
</div>
</div>
</div>

</section>
</div>
  
<footer class="main-footer" th:replace="main_layout::footer">
</footer>


<aside class="control-sidebar control-sidebar-light">
</aside>

<div class="control-sidebar-bg" ></div>

</div>

<!-- 联系人选择对话框 S -->
<div class="modal fade" id="select_lxr_modal" role="dialog">
<div class="modal-dialog modal-lg"  role="document">
<div class="modal-content">
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	<h4 class="modal-title" >选择联系人</h4>
</div>
<div class="modal-body">
<input type="hidden" id="report_id" />
<table class="table table-bordered table-hover" id="select_lxr_table">
	<thead>
	<tr>
		<th>编号</th>
		<th>部门</th>
		<th>名称</th>
      	<th>职务</th>
		<th>电话号码</th>
		<th>电子邮件</th>
		<th>操作</th>
	</tr>
	<thead>
</table>

</div><!-- /.modal-body -->

</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- 联系人选择对话框 E  -->

<script th:src="@{/lib/DataTables/1.10.15/datatables.min.js}"></script>
<script th:src="@{/lib/DataTables/datatables.config.js}"></script>
<script th:src="@{/lib/jquery-validation/1.16.0/jquery.validate.min.js}"></script>
<script th:src="@{/lib/jquery-validation/1.16.0/messages_zh.js}"></script>
<script th:src="@{/lib/moment/2.18.1/moment.min.js}"></script>
<script th:src="@{/lib/sweetalert2/6.6.5/sweetalert2.min.js}"></script>
<script th:src="@{/lib/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js}"></script>
<script th:src="@{/lib/bootstrap-datepicker/1.6.4/locales/bootstrap-datepicker.zh-CN.min.js}"></script>
<script>

//选择联系人
function select_lxr() {
	if(!select_lxr_table) {
		select_lxr_table = $('#select_lxr_table').DataTable({
			select: false,
			searching: true,
			order: [0, 'desc'],
	        ajax: {
	            url: "[[@{/apply/lxr/list}]]",
	            type: 'POST',
	            dataSrc: ''
	        },
	        columnDefs: [
	        	{targets:0, width:'40px'},
	        	{targets: -1, orderable: false,  width: "60px",  className: "align_center", render: function(data, type, full, meta ) {
	            	return	"<a href = 'javascript:;' onclick='lxr_select(" + full[0] + ")'>选择</a>";
	            }}
	        ]
		});
	}
	$("#select_lxr_modal").modal({backdrop:'static', keyboard: false});	
}
function lxr_select(id) {
	select_lxr_table.data().each(function(row) {
		if(row[0] == id) {
			$("#yfLxr").val(row[2]);
			$("#yfDzyj").val(row[5]);
		}
	})
	$("#select_lxr_modal").modal('hide');
}
</script>
</body>
</html>
